package com.ihr360.excel.aggregatemodule.service;

import com.ihr360.commons.vo.ResultInfo;
import com.ihr360.excel.aggregatemodule.service.fallback.ExcellServiceFallback;
import com.ihr360.excel.vo.ImportResult;
import com.ihr360.excel.vo.ProgressContext;
import com.ihr360.excel.vo.ProgressResult;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "ihr360-excel-provider", fallback = ExcellServiceFallback.class)
public interface ExcelCloudService {


    @RequestMapping(value = "/excelCloud/handleProcess", method = RequestMethod.POST)
    void handleExcel(@RequestBody ProgressContext progressContext);

    @RequestMapping(value = "/excelCloud/processorJournal", method = RequestMethod.POST)
    void saveExcelProcessorJournal(@RequestBody ProgressContext progressContext, @RequestParam(value = "errorMsg") String errorMsg);
    
    @RequestMapping(value = "/excelCloud/progressResult", method = RequestMethod.POST)
    ProgressResult getProgressResult(@RequestBody ProgressContext progressContext);

    @RequestMapping(value = "/excelCloud/importResult", method = RequestMethod.POST)
    ImportResult getImportResult(@RequestBody ProgressContext progressContext);

    @RequestMapping(value = "/excelCloud/interruptProgress", method = RequestMethod.POST)
    ResultInfo interruptProgress(@RequestBody ProgressContext progressContext);

    @RequestMapping(value = "/excelCloud/errorFileId", method = RequestMethod.POST)
    String getErrorFileId(@RequestBody ProgressContext progressContext);
}



